# Relies on the NETPBM tools, if you don't recognise them.
# Generated data just gets sent to stdout, where you'll cut&paste 
# into your assembler file.
# --
# Chris Baird,, <chris.j.baird@gmail> 2021
#
# xterm -fa PetMe2Y -fs 18 ..and then edit to fix the decenders..
# clear; printf '%b' $(printf '\\x%x\x0a' {32..127})

FOO=/tmp/$$.pnm

anytopnm $1 >$FOO
c=100
for x in `seq 008 8 759`
do
 pamcut <$FOO -left $x -top 0 -width 7 -height 8 >chars_${c}.pnm
 c=$(( $c + 1))
 pamcut <$FOO -left $x -top 7 -width 7 -height 8 >chars_${c}.pnm
 c=$(( $c + 1))
done

for i in chars_*
do 
  pamthreshold $i 2>/dev/null|pnminvert|pnmflip -xy |pamtopnm|pbmtoxbm
done|grep x|sed -e 's/^ //g' -e 's/};/,/g'|fmt -w 80|sed -e 's/ //g' -e 's/^/{/g' -e 's/,$/},/'

rm -f chars_* $FOO


